package me.a_littlesquid.origin.origins;

import me.a_littlesquid.origin.FileManager;
import me.a_littlesquid.origin.items.*;
import me.a_littlesquid.origin.utils.Bind;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.potion.PotionEffect;

import java.io.File;

import static org.bukkit.potion.PotionEffectType.*;

public class originlist {
    public originlist(FileConfiguration data, File filedata, Player player){
        this.data=data;
        this.filedata=filedata;
        this.player=player;
    }
    private  FileConfiguration data;
    private  File filedata;
    private  Player player;

    public void setck(){
        PlayerInventory playerInventory=player.getInventory();
        PotionEffect liliang=new PotionEffect(INCREASE_DAMAGE,1728000,3,false,true,true);
        PotionEffect sudu=new PotionEffect(SPEED,1728000,1,false,true,true);
        PotionEffect baohe=new PotionEffect(SATURATION,1728000,5,false,true,true);
        PotionEffect jipo=new PotionEffect(FAST_DIGGING,1728000,2,false,true,true);
        LivingEntity entity=player;
        entity.addPotionEffect(liliang);
        entity.addPotionEffect(sudu);
        entity.addPotionEffect(baohe);
        entity.addPotionEffect(jipo);
        entity.setMaxHealth(10);
        ItemStack sword=ck.getsword();
        Bind.bind(player,sword,playerInventory);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","ck");
        FileManager.reloadfile(data,filedata);
    }
    public void setzt(){
        PlayerInventory playerInventory=player.getInventory();
        PotionEffect kangxing=new PotionEffect(DAMAGE_RESISTANCE,1728000,1,false,true,true);
        PotionEffect huanman=new PotionEffect(SLOW,1728000,1,false,true,true);
        PotionEffect jie=new PotionEffect(HUNGER,1728000,1,false,true,true);
        LivingEntity entity=player;
        entity.addPotionEffect(kangxing);
        entity.addPotionEffect(huanman);
        entity.addPotionEffect(jie);
        entity.setMaxHealth(40);
        ItemStack shield= zt.getshield();
        Bind.bind(player,shield,playerInventory);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","zt");
        FileManager.reloadfile(data,filedata);
    }
    public void setzzgw(){
        PlayerInventory playerInventory=player.getInventory();
        PotionEffect xvruo=new PotionEffect(WEAKNESS,1728000,1,false,true,true);
        PotionEffect sudu=new PotionEffect(SPEED,1728000,1,false,true,true);
        LivingEntity entity=player;
        entity.addPotionEffect(xvruo);
        entity.addPotionEffect(sudu);
        ItemStack block= zzgw.getBlock();
        Bind.bind(player,block,playerInventory);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","zzgw");
        FileManager.reloadfile(data,filedata);
    }
    public void setxt(){
        PlayerInventory playerInventory=player.getInventory();
        PotionEffect shengmingghuifu=new PotionEffect(REGENERATION,1728000,2,false,true,true);
        PotionEffect liliang=new PotionEffect(INCREASE_DAMAGE,1728000,1,false,true,true);
        PotionEffect jipo=new PotionEffect(FAST_DIGGING,1728000,1,false,true,true);
        PotionEffect sudu=new PotionEffect(SPEED,1728000,1,false,true,true);
        PotionEffect jie=new PotionEffect(HUNGER,1728000,1,false,true,true);
        LivingEntity entity=player;
        entity.addPotionEffect(shengmingghuifu);
        entity.addPotionEffect(liliang);
        entity.addPotionEffect(jipo);
        entity.addPotionEffect(sudu);
        entity.addPotionEffect(jie);
        entity.setMaxHealth(16);
        ItemStack axe= xt.getaxe();
        ItemStack pickaxe=xt.getpickaxe();
        ItemStack shovel=xt.getshovel();
        Bind.bind(player,axe,playerInventory);
        Bind.bind(player,pickaxe,playerInventory);
        Bind.bind(player,shovel,playerInventory);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","xt");
        FileManager.reloadfile(data,filedata);
    }
    public void setqs(){
        PlayerInventory playerInventory=player.getInventory();
        PotionEffect sudu=new PotionEffect(SPEED,1728000,1,false,true,true);
        PotionEffect kangxing=new PotionEffect(DAMAGE_RESISTANCE,1728000,1,false,true,true);
        PotionEffect liliang=new PotionEffect(INCREASE_DAMAGE,1728000,1,false,true,true);
        PotionEffect huanjiang=new PotionEffect(SLOW_FALLING,1728000,1,false,true,true);
        LivingEntity entity=player;
        entity.addPotionEffect(sudu);
        entity.addPotionEffect(kangxing);
        entity.addPotionEffect(liliang);
        entity.addPotionEffect(huanjiang);
        entity.setMaxHealth(16);
        ItemStack AXE= qs.getaxe();
        Bind.bind(player,AXE,playerInventory);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","qs");
        FileManager.reloadfile(data,filedata);
    }
    public void setmy(){
        PlayerInventory playerInventory=player.getInventory();
        LivingEntity entity=player;
        entity.setMaxHealth(10);
        PotionEffect sudu=new PotionEffect(SPEED,1728000,1,false,true,true);
        PotionEffect kangxing=new PotionEffect(DAMAGE_RESISTANCE,1728000,2,false,true,true);
        entity.addPotionEffect(sudu);
        entity.addPotionEffect(kangxing);
        ItemStack peral=my.getpearl();
        ItemStack sword=my.getsword();
        Bind.bind(player,peral,playerInventory);
        Bind.bind(player,sword,playerInventory);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","my");
        FileManager.reloadfile(data,filedata);
    }
    public void setzs(){
        LivingEntity entity=player;
        PotionEffect kangxing=new PotionEffect(DAMAGE_RESISTANCE,1728000,1,false,true,true);
        entity.addPotionEffect(kangxing);
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","zs");
        FileManager.reloadfile(data,filedata);
    }
    public void setpt(){
        String playername=player.getDisplayName();
        data.set("playerlist."+playername+".origin","pt");
        FileManager.reloadfile(data,filedata);
    }
}
